<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>我的求购</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" href="../../../elementUI/index.css">
    <link rel="stylesheet" href="../../../css/index.css">
</head>

<body>
    <div id="app" class="minWidth">
        <el-form :inline="true" :form="form">
            <el-form-item>
                <el-input clearable v-model="form.serachKey" placeholder="请输入商品名称" />
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="onSerach">查询</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="addEnterprise">发布</el-button>
            </el-form-item>
            <el-form-item>
                <el-button type="primary" @click="window.location.href = './Show.html'">我的求购</el-button>
                <el-badge :value="badge" :max="99" :hidden="badge == 0?true:false" class="item">
                    <el-button @click="window.location.href = './message.html'">消息</el-button>
                </el-badge>
            </el-form-item>
        </el-form>

        <el-table :data="tableData.slice((form.page-1)*form.limit,form.page*form.limit)" stripe border
            height="calc(100vh - 140px)" style="width: 100%">
            <el-table-column align="center" label="序号" width="50" type="index"></el-table-column>
            <el-table-column align="center" prop="Article_Name" label="商品名"></el-table-column>
            <el-table-column align="center" prop="Release_Type" label="状态" width="150">
                <template v-slot="{row}">
                    <el-tag v-if="row.Total_Quantity!=row.Acquisition_Quantity" type="danger" size="small">求购中</el-tag>
                    <el-tag v-else type="success" size="small">已收购足量</el-tag>
                </template>
            </el-table-column>
            <el-table-column align="center" prop="Total_Quantity" label="需求总量"></el-table-column>
            <el-table-column align="center" prop="Starting_Quantity" label="起步量"></el-table-column>
            <el-table-column align="center" prop="Acquisition_Quantity" label="已收购量"></el-table-column>
            <el-table-column align="center" prop="Residue_Quantity" label="剩余需求量"></el-table-column>
            <el-table-column align="center" prop="Amount" label="预定金额"></el-table-column>
            <el-table-column align="center" prop="Unit" label="商品单位"></el-table-column>
            <el-table-column align="center" prop="Contacts" label="联系人"></el-table-column>
            <el-table-column align="center" prop="Enterprise_Name" label="企业名称">
                <template v-slot="{row}">
                    <div :title="row.Enterprise_Name" style="width: 100%;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;">
                        <span>{{row.Enterprise_Name}}</span>
                    </div>
                </template>
            </el-table-column>
            <el-table-column align="center" label="操作" width="200">
                <template v-slot="{row}">
                    <div v-show="row.Enterprise_Info_SerialNumber==Enterprise_Info_SerialNumber">
                        <el-button v-if="row.Total_Quantity==row.Acquisition_Quantity" type="primary" v-if="true" size="small">取消需求</el-button>
                    </div>
                </template>
            </el-table-column>
        </el-table>
        <el-pagination background v-show="total > 0" @size-change="handleSizeChange"
            @current-change="handleCurrentChange" :current-page="form.page" :page-sizes="[10,20,30,50]"
            :page-size="form.limit" layout="total, sizes, prev, pager, next, jumper" :total="total">
        </el-pagination>
    </div>
    <script type="text/javascript" src="../../../js/jquery-3.6.0.min.js"></script>
    <script type="text/javascript" src="../../../js/jquery.cookie.js"></script>
    <script type="text/javascript" src="../../../js/vue.min.js"></script>
    <script type="text/javascript" src="../../../elementUI/index.js"></script>
    <script type="text/javascript" src="../../../js/utils.js"></script>
    <script type="text/javascript" src="./js/Procurementneeds.js"></script>
</body>

</html>